#include <string.h>
#include <stdio.h>
#include <stdlib.h>

char word[256]={0};
int index = 0;

int const KEY_SIZE = 11;

char key[KEY_SIZE][8] = {"int","float","long","short","double","char","while","for","goto", "const", "return"};

int isKey(char* str) {
	for (int i = 0; i < KEY_SIZE; i++) {
		if (strcmp(str, key[i]) == 0) return 1;
	}
	return 0;
}

int isChar(char c) {
	if (c >= 'a' || c <= 'z' || c >= 'A' || c <= 'Z'){
		return 1;
	} else {
		return 0;
	}
}

int isDigit(char c) {
	if (c >= '0' || c <= '9'){
		return 1;
	} else {
		return 0;
	}
}

void clear(char* word) {
	memset(word, 0, 80);
	index = 0;
}
int isSymbol(char c) {
	if (isChar(c) || isDigit(c) || c == '_') {
		return 1;
	}
	return 0;
}
void ignoreComment(char* word) {
	char ch;
	while(scanf("%c", &ch)) {
		if (ch = '\n') break;
	}
	clear(word);
}

int isIdentify(char* str) {
	int len = strlen(str);
	if (isChar(str[0])) {
		for (int i = 1; i < len; i++) {
			if (isSymbol(str[i])) {
			} else {
				return 0;
			}
		}			
	}
	return 1;
}

void print(char* str, char* sentence) {
	printf("%s\t%s\n", str, sentence);
	clear(str);
}

int isBlank(char c) {
	if (c == ' ') {
		return 1;
	} else {
		return 0;
	}
}

char* trim(char* str) {
	char* origin = str;
	int len = strlen(str);

	char* end = str + (len-1);
	char* begin = str;
	if (*end == '\n') {
		*end-- = '\0';
	}
	while (isBlank(*end)) {
		end--;
	}
	while (isBlank(*begin)) {
		begin++;
	}
	while (begin <= end) 
		*str++ = *begin++;
	*str = '\0';
	return origin;
} 

void symbol(char* str) {
	//str = trim(str);
	int len = strlen(str);
	if (0 == len)
		return;
	if (isKey(str)) {
		print(str, "$keyWord");
	} else if (isIdentify(str)){
		print(str, "$identify");
	}

}
void operatorSymbol(char* str, int i) {
	char c = str[i];
	str[i] = '\0';
	printf("%c\t%s\n", c, "$operator");
	index = strlen(str);
}


int main() {
	freopen("./input.txt", "r", stdin);
	while (scanf("%c",&word[index])!=EOF) {
		switch(word[index]) {
		case '#' : ignoreComment(word); break;
		case '(' : 
		case ')' : 
		case '\'' :
		case '{' : 
		case '}' : 
		case '=' : 
		case ';' : 
		case ',' : operatorSymbol(word, index-1);symbol(word);break;
		case '\n': word[index]='\0';symbol(word);break;
		case ' ' : symbol(word); break;
		}
		index++;
		//if (word[index] == '\n') continue;
		//printf("\n**%c**\n", word[index++]);
	}
}



